import request from '../http/index.js';

export default {
	// 获取景点详情
	getScenicDetail(data) {
		return request({
			url: '/api/scenic/scenic/detail',
			method: 'GET',
			data
		})
	},
	
	// 获取景点图片列表
	getScenicPhotos(data) {
		return request({
			url: '/api/scenic/photo/list',
			method: 'GET',
			data
		})
	},
	
	// 获取门票列表
	getTicketList(data) {
		return request({
			url: '/api/ticket/list',
			method: 'GET',
			data
		})
	},
	
	// 获取门票详情
	getTicketDetail(data) {
		return request({
			url: '/api/ticket/detail',
			method: 'GET',
			data
		})
	},
	
	// 收藏/取消收藏
	addFavorite(data) {
		// 将参数拼接到URL上
		const params = new URLSearchParams(data).toString();
		return request({
			url: `/api/favorite/add?${params}`,
			method: 'POST'
		})
	},
	
	removeFavorite(data) {
		// 将参数拼接到URL上
		const params = new URLSearchParams(data).toString();
		return request({
			url: `/api/favorite/remove?${params}`,
			method: 'POST'
		})
	},
	
	checkFavorite(data) {
		return request({
			url: '/api/favorite/check',
			method: 'GET',
			data
		})
	},
	
	getFavoriteList(data) {
		return request({
			url: '/api/favorite/list',
			method: 'GET',
			data
		})
	},
	
	// 评论相关
	getCommentList(data) {
		return request({
			url: '/api/comment/list',
			method: 'GET',
			data
		})
	},
	
	addComment(data) {
		// 将参数拼接到URL上
		const params = new URLSearchParams(data).toString();
		return request({
			url: `/api/comment/add?${params}`,
			method: 'POST'
		})
	},
	
	likeComment(data) {
		// 将参数拼接到URL上
		const params = new URLSearchParams(data).toString();
		return request({
			url: `/api/comment/like?${params}`,
			method: 'POST'
		})
	},
	
	unlikeComment(data) {
		// 将参数拼接到URL上
		const params = new URLSearchParams(data).toString();
		return request({
			url: `/api/comment/unlike?${params}`,
			method: 'POST'
		})
	},
	
	deleteComment(data) {
		// 将参数拼接到URL上
		const params = new URLSearchParams(data).toString();
		return request({
			url: `/api/comment/delete?${params}`,
			method: 'POST'
		})
	},
	
	// 用户足迹
	addUserStep(data) {
		// 将参数拼接到URL上
		const params = new URLSearchParams(data).toString();
		return request({
			url: `/api/user/step/add?${params}`,
			method: 'POST'
		})
	},
	
	getUserStepList(data) {
		return request({
			url: '/api/user/step/list',
			method: 'GET',
			data
		})
	},
	
	// 订单相关
	createOrder(data) {
		return request({
			url: '/api/order/create',
			method: 'POST',
			data
		})
	},
	
	getOrderDetail(data) {
		return request({
			url: '/api/order/detail',
			method: 'GET',
			data
		})
	},
	
	getOrderList(data) {
		return request({
			url: '/api/order/list',
			method: 'GET',
			data
		})
	},
	
	cancelOrder(data) {
		return request({
			url: '/api/order/cancel',
			method: 'POST',
			data
		})
	},
	
	// 支付相关
	createPayment(data) {
		return request({
			url: '/api/payment/create',
			method: 'POST',
			data
		})
	},
	
	payOrder(data) {
		return request({
			url: '/api/payment/pay',
			method: 'POST',
			data
		})
	},
	
	// 优惠券相关
	getAvailableCoupons(data) {
		return request({
			url: '/api/coupon/available',
			method: 'GET',
			data
		})
	},
	
	getUserCoupons(data) {
		return request({
			url: '/api/coupon/my',
			method: 'GET',
			data
		})
	},
	
	receiveCoupon(data) {
		return request({
			url: '/api/coupon/receive',
			method: 'POST',
			data
		})
	},
	
	// 聊天相关
	getChatSessions(data) {
		return request({
			url: '/api/chat/sessions',
			method: 'GET',
			data
		})
	},
	
	getChatMessages(data) {
		return request({
			url: '/api/chat/messages',
			method: 'GET',
			data
		})
	},
	
	sendMessage(data) {
		return request({
			url: '/api/chat/send',
			method: 'POST',
			data
		})
	},
	
	// DeepSeek AI对话接口
	deepseekChat(data) {
		return request({
			url: '/api/ai/deepseek/chat',
			method: 'POST',
			data
		})
	},
	
	// DeepSeek AI补全接口
	deepseekCompletion(data) {
		return request({
			url: '/api/ai/deepseek/completion',
			method: 'POST',
			data
		})
	},
	
	// 客服相关
	getServiceInfo(data) {
		return request({
			url: '/api/chat/service/info',
			method: 'GET',
			data
		})
	},
	
	createChatSession(data) {
		// 将参数拼接到URL上
		const params = new URLSearchParams(data).toString();
		return request({
			url: `/api/chat/session/create?${params}`,
			method: 'POST'
		})
	},
	
	// 用户主页
	getUserProfile(data) {
		return request({
			url: '/api/user/profile',
			method: 'GET',
			data
		})
	},
	
	getUserVisitedScenics(data) {
		return request({
			url: '/api/user/visited',
			method: 'GET',
			data
		})
	},
	
	// 关注/取消关注
	followUser(data) {
		return request({
			url: '/api/user/follow',
			method: 'POST',
			data
		})
	},
	
	unfollowUser(data) {
		return request({
			url: '/api/user/unfollow',
			method: 'POST',
			data
		})
	}
};
